import service from "@/utils/fetch";
const post = {
  //查询消息分页
  messageList(params) {
    return service({
      method: "get",
      params,
      url: "/api/message/"
    });
  },

  //新增消息
  addMessage(params) {
    return service({
      method: "post",
      data: params,
      url: "/api/message/"
    });
  },

  //编辑消息
  editMessage(params) {
    return service({
      method: "put",
      data: params,
      url: "/api/message/"
    });
  },

  //删除消息
  deleteMessage(ids) {
    return service({
      method: "delete",
      data: ids,
      url: `/api/message/`
    });
  },

  //查询消息详情
  messageDetail(id) {
    return service({
      method: "get",
      url: `/api/message/${id}`
    });
  },

  // 发布消息
  publishMessage(id) {
    return service({
      method: "post",
      url: `/api/message/publish?id=${id}`
    });
  }
};

export default post;
